.TH std::chrono::nonexistent_local_time 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::chrono::nonexistent_local_time \- std::chrono::nonexistent_local_time

.SH Synopsis
   Defined in header <chrono>
   class nonexistent_local_time;  \fI(since C++20)\fP

   Defines a type of object to be thrown as exception to report that an attempt was
   made to convert a nonexistent std::chrono::local_time to a std::chrono::sys_time
   without specifying a std::chrono::choose (such as choose::earliest or
   choose::latest).

   This exception is thrown by std::chrono::time_zone::to_sys and functions that call
   it (such as the constructors of std::chrono::zoned_time that take a
   std::chrono::local_time).

   std-chrono-nonexistent local time-inheritance.svg

                                   Inheritance diagram

.SH Member functions

   constructor   constructs the exception object
                 \fI(public member function)\fP
   operator=     replaces the exception object
                 \fI(public member function)\fP
   what          returns the explanatory string
                 \fI(public member function)\fP

std::chrono::nonexistent_local_time::nonexistent_local_time

   template< class Duration >

   nonexistent_local_time( const std::chrono::local_time<Duration>&   \fB(1)\fP \fI(since C++20)\fP
   tp,

                           const std::chrono::local_info& i );
   nonexistent_local_time( const nonexistent_local_time& other )      \fB(2)\fP \fI(since C++20)\fP
   noexcept;

   Constructs the exception object.

   1) The explanatory string returned by what() is equivalent to that produced by
   os.str() after the following code:

 std::ostringstream os;
 os << tp << " is in a gap between\\n"
    << std::chrono::local_seconds(i.first.end.time_since_epoch()) + i.first.offset
    << ' ' << i.first.abbrev << " and\\n"
    << std::chrono::local_seconds(i.second.begin.time_since_epoch()) + i.second.offset
    << ' ' << i.second.abbrev
    << " which are both equivalent to\\n"
    << i.first.end << " UTC";

   The behavior is undefined if i.result != std::chrono::local_info::nonexistent.
   2) Copy constructor. If *this and other both have dynamic type
   std::chrono::nonexistent_local_time then std::strcmp(what(), other.what()) == 0.

.SH Parameters

   tp    - the time point for which conversion was attempted
   i     - a std::chrono::local_info describing the result of the conversion attempt
   other - another nonexistent_local_time to copy

.SH Exceptions

   May throw std::bad_alloc

.SH Notes

   Because copying a standard library class derived from std::exception is not
   permitted to throw exceptions, this message is typically stored internally as a
   separately-allocated reference-counted string.

std::chrono::nonexistent_locale_time::operator=

   nonexistent_locale_time& operator=( const nonexistent_locale_time&     \fI(since C++20)\fP
   other ) noexcept;

   Assigns the contents with those of other. If *this and other both have dynamic type
   std::chrono::nonexistent_locale_time then std::strcmp(what(), other.what()) == 0
   after assignment.

.SH Parameters

   other - another exception object to assign with

.SH Return value

   *this

std::chrono::nonexistent_locale_time::what

   virtual const char* what() const noexcept;  \fI(since C++20)\fP

   Returns the explanatory string.

.SH Parameters

   \fI(none)\fP

.SH Return value

   Pointer to a null-terminated string with explanatory information. The string is
   suitable for conversion and display as a std::wstring. The pointer is guaranteed to
   be valid at least until the exception object from which it is obtained is destroyed,
   or until a non-const member function (e.g. copy assignment operator) on the
   exception object is called.

.SH Notes

   Implementations are allowed but not required to override what().

Inherited from std::runtime_error

Inherited from std::exception

.SH Member functions

   destructor   destroys the exception object
   \fB[virtual]\fP    \fI(virtual public member function of std::exception)\fP
   what         returns an explanatory string
   \fB[virtual]\fP    \fI(virtual public member function of std::exception)\fP

.SH See also

   ambiguous_local_time exception thrown to report that a local time is ambiguous
   (C++20)              \fI(class)\fP
